<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<title>Canvas</title>
		<script type="text/javascript" src="../build/dist.js"></script>
		<!--[if IE]><script src="../excanvas/excanvas.js"></script><![endif]-->
	</head>
	<body>
		<canvas id="c" width="400" height="300"></canvas>
		<div id="counter"></div>
		<script type="text/javascript">//<![CDATA[
var canvas, ctx, count=0, timer, start, w, h, counter=document.getElementById('counter');
window.onload = function() {
	try {
		var el=document.getElementById('c');
		canvas=new Curly.Canvas(el);
		el.style.border='1px solid #AAA';
		
		ctx=canvas.getCtx();
		w=canvas.getWidth();
		h=canvas.getHeight();
		canvas.overwriteState('strokeStyle', 'red');
		
		start=(new Date()).getTime();
		timer=setInterval(draw, 1);
	}
	catch(e) {
		alert(e);
	}
}

var i=0, j=0;
function draw() {
	if(count++>100) {
		window.clearInterval(timer);
		var diff=((new Date()).getTime()-start)/1000;
		counter.innerHTML=diff+'s, '+(count/diff)+'fps';
	}
	
	canvas.
		path(0, i+=4).
		lineTo(j+=6, 0).
		draw(false, true);
}
//		]]></script>
	</body>
</html>